home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEV / A-B / add images.cpt / about_alert.c < prev    next >
Text File  |  1989-06-22  |  2KB  |  111 lines

  1. /* *******************************
  2.  
  3. File: about_alert.c
  4. Function: Handle all operations for this Alert
  5. History:    4/27/89 Original by Prototyper.
  6.             4/27/89 Modified by c. keith ray
  7.  
  8.   This is a NOTE alert, it is used to inform the user of some general information.
  9.   This alert is not used if there is a possibility of losing any data.
  10.  
  11. ******************************* */
  12.  
  13. #include "about_alert.h"
  14. #include <IM1_5Protos.h>
  15.  
  16. /* *********************************** */
  17. /* These are the other includes for general routines */
  18.  
  19. /* #include <Strings.h> */
  20. extern char *strcpy (Str255 *, char *);    /* LSC string prototype */
  21.  
  22. /* *********************************** */
  23.  
  24. #define      TRUE   1
  25. #define      FALSE  0
  26. #define      NIL    0
  27.  
  28. /* *********************************** */
  29.  
  30.  
  31. void A_about_alert ()
  32. {
  33.  
  34. #define  I_OK  1
  35. #define  I_x  2
  36. #define  I_x3  3
  37.     short itemHit;
  38.  
  39.     /* Let the OS handle the Alert and wait for a result to be returned */
  40.     itemHit = NoteAlert (about_alert_id, NIL);
  41.  
  42.     /* This is a button that may have been pressed. */
  43.     if (I_OK == itemHit)
  44.     {
  45.     }
  46.  
  47.  
  48. }
  49.  
  50. #define  I_What_can_you_do   1
  51. #define  I_text                2
  52. #define  I_outtext            3
  53.  
  54.  
  55. /* ======================================================== */
  56.  
  57.  
  58. void   D_error_alert(err_num)
  59.     long err_num;
  60. {
  61.  
  62.         char            ExitDialog;
  63.         DialogPtr        GetSelection;
  64.         Handle            DItem;
  65.         Rect            tempRect;
  66.         short            DType;
  67.         short            itemHit;
  68.         char          err_string[255];
  69.         GrafPtr            saveport;
  70.         
  71.         GetPort(&saveport);
  72.  
  73.         GetSelection = GetNewDialog(error_dialog_id, NIL, (WindowPtr)-1);
  74.         ShowWindow(GetSelection);
  75.         SelectWindow(GetSelection);
  76.         SetPort(GetSelection);
  77.  
  78.         /* Setup initial conditions */
  79.  
  80.         NumToString( err_num, (char *)&err_string );
  81.         GetDItem (GetSelection, I_outtext, &DType, &DItem, &tempRect);
  82.  
  83.         SetIText (DItem, (char *)&err_string);
  84.  
  85.         ExitDialog = FALSE;
  86.  
  87.         do
  88.         {
  89.                 ModalDialog(NIL, &itemHit);
  90.                 GetDItem(GetSelection, itemHit, &DType, &DItem, &tempRect);
  91.  
  92.                 /* Handle it real time */
  93.                 if (itemHit == I_What_can_you_do )
  94.                 {
  95.                         /* ?? Code to handle this button goes here */
  96.                         ExitDialog =TRUE;
  97.                 }
  98.  
  99.  
  100.         }
  101.         while (ExitDialog == FALSE);
  102.  
  103.         /* Get results after dialog */
  104.  
  105.         DisposDialog(GetSelection);
  106.  
  107.         SetPort( saveport );
  108. }
  109.  
  110.  
  111.